/**
 * 
 */
package org.dse.dao;

import java.util.List;

import org.dse.beans.KeywordIndex;

/**
 * This class use Hibernate technology to implement additional methods the
 * KeywordIndexDAO has.
 * 
 * @author zhangchen
 * 
 */
public class KeywordIndexHibernateDAO extends
		GenericHibernateDAO<KeywordIndex, Integer> implements KeywordIndexDAO {

	/**
	 * Use HQL to query indexes using the keyword.
	 * 
	 * @param keyword
	 *            the keyword
	 * @return a List containing all the indexes
	 */
	@SuppressWarnings("unchecked")
	public List<KeywordIndex> findByKeyword(String keyword) {
		String queryString = "from KeywordIndex as k where k.keyword = ?";
		List<KeywordIndex> indexList = getHibernateTemplate().find(queryString,
				keyword);

		return indexList;
	}
}
